package com.qiaoba.api.auth.constant;

/**
 * 安全常量
 *
 * @author ailanyin
 * @version 1.0
 * @since 2022/9/8 0008 下午 14:54
 */
public interface SecurityConstant {

    String LOGOUT_URI = "/logout";
    String HAS_BEEN_PULLED_BLACK = "你的IP已经被系统拉黑, 请联系管理员处理";
    String ACCESS_DENIED = "暂无权限访问, 请重新登录";
    String BLACKLIST_KEY = "login:blacklist:";
    String LOGIN_ERROR_COUNT = "login:errorCount:";
    String BLACKLIST_ON = "true";

    String CAPTCHA_KEY = "login:captcha:";

    String REDIS_SECRET_KEY = "sys:secret:";
    String JWT_SECRET_KEY = REDIS_SECRET_KEY + "jwt_secret";
    String USER_DETAILS_REDIS_KEY = "login:user_details:";

    /**
     * 密码错误
     */
    String PASSWORD_ERROR = "密码错误";

    /**
     * token header
     */
    String TOKEN_HEADER = "Authorization";

    /**
     * token前缀
     */
    String TOKEN_HEAD = "Bearer ";

    /**
     * Token Redis Key
     */
    String LOGIN_USER_TOKENS_REDIS_KEY = "login:token:";

    /**
     * 默认的Token有效期（3小时）
     */
    Integer DEFAULT_TOKEN_EXPIRE_TIME = 10800;

}
